<?php
/* @var $this PurchaseController */
/* @var $model Purchase */
/* @var $form CActiveForm */
?>
<h1>Purchase</h1>
<div class="form">

    <?php
    $form = $this->beginWidget('CActiveForm', array(
        'id' => 'purchase-purchase-form',
        // Please note: When you enable ajax validation, make sure the corresponding
        // controller action is handling ajax validation correctly.
        // See class documentation of CActiveForm for details on this,
        // you need to use the performAjaxValidation()-method described there.
        'enableAjaxValidation' => false,
    ));
    ?>

    <p class="note">Fields with <span class="required">*</span> are required.</p>

    <?php
    echo '<h3>' . $msg . '</h3>';
    ?>

    <?php echo $form->errorSummary($model); ?>
    <div class="wide form">
    <div class="row">
        <?php echo $form->labelEx($model, 'item_id'); ?>
        <?php
        $this->widget('ext.myautocomplete', array(
            'model' => $model,
            'attribute' => 'item_id',
            'name' => 'item_autocomplete',
            'source' => $this->createUrl('inventory/autoComplete'),
            'options' => array(
                'minLength' => '0',
            ),
            'htmlOptions' => array(
                'style' => 'height:25px;',
                'placeholder'=>'Type Item name'
            ),
        ));
        ?>
        <?php echo $form->error($model, 'item_id'); ?>
    </div>
    <div class="row">
        <?php echo $form->labelEx($model, 'quantity'); ?>
        <?php echo $form->textField($model, 'quantity'); ?>
        <?php echo $form->error($model, 'quantity'); ?>
    </div>

    

    <!--	<div class="row">
    <?php echo $form->labelEx($model, '_by'); ?>
    <?php echo $form->textField($model, '_by'); ?>
    <?php echo $form->error($model, '_by'); ?>
            </div>-->

    <div class="row">
        <?php echo $form->labelEx($model, 'amount'); ?>
        <?php echo $form->textField($model, 'amout'); ?>
        <?php echo $form->error($model, 'amout'); ?>
    </div>

    <!--	<div class="row">
    <?php echo $form->labelEx($model, 'date_at'); ?>
    <?php echo $form->textField($model, 'date_at'); ?>
    <?php echo $form->error($model, 'date_at'); ?>
            </div>-->


    <div class="row buttons">
        <?php echo CHtml::submitButton('Submit'); ?>
    </div>
    <?php $this->endWidget(); ?>
</div>
</div><!-- form -->